package com.example.business_oa.service;

import com.example.comment_oa.dubbo.SysDeptServiceDubbo;
import com.example.comment_oa.pojos.SysDept;
import com.example.comment_oa.response.AjaxResponse;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:dubbo
 * @Author:陈旭良
 * @Documents_And_Settings:liang
 * @Date:2022/10/20 14:50
 * @Entry_Name:my_springcloud_project01cangku
 */
@Service
public class CallService {
    @DubboReference(version = "1.0.0")
    SysDeptServiceDubbo sysDeptServiceDubbo;


//    @DubboReference(version = "1.0.0")
//    PublicWareServiceDubbo publicWareServiceDubbo;

    @GlobalTransactional(timeoutMills = 300000)
    public AjaxResponse DeptAll(){return  sysDeptServiceDubbo.selectDept();}

    @GlobalTransactional(timeoutMills = 300000)
    public List<SysDept> PositionAll(int PositionAllId){
        return  sysDeptServiceDubbo.selectDeptPost(PositionAllId);
    }
}
